home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / utils / patchfor020 / patchfor020.doc < prev    next >
Encoding:
Text File  |  1980-01-04  |  13.5 KB  |  333 lines

  1. ______________________________________________________________________________
  2.  
  3.                                     /
  4.                                                                      /
  5. \                               /\/                               /\/
  6.                                /                                     
  7.    \              _________ ____ ____ ____ ____     /\      /
  8.           .---\_  __  /|    ¡    |    ¡    |----.      /
  9.           |:::|      / |    |    |    |    |::::|  \  /
  10.           |:::|     ___|__  |  __|    |    |__.:|   \/
  11.           |:::|    |   |         |            |:|
  12.           |:::|    ¡   |    ¡    |----.    .--':|
  13.          /|:::|        |    |    |    |    |::::|
  14.         / `---^--------^----^----'    `----^----'
  15.     \  /                                              \                /
  16.      \/       /   »»»»»-[ pRoUDLY pReSeNTS ]-««««««         /\        /
  17.              /                                          \  /  \      /
  18.         /\  /                                            \/    \    / 
  19.        /  \/                                                    \  /
  20.       /                     "PatchFor020"                        \/
  21.  
  22.     /  A tool which patches MC68000 specific routines in Executables files to
  23.     their MC68020 equivelents to improve performance on 020`CPU`s and above!
  24.  
  25.  
  26.                         An EX4-Production for `95!
  27.  
  28.          ** NB: Requirements: OS2+, MC68020+ & "reqtools.library" **
  29. ______________________________________________________________________________
  30.  
  31.  
  32.  
  33.  
  34.                                Introduction
  35.            -----------------------------------------------------
  36.  
  37. This program was written specifically to get some speed gains on MC68020+`s
  38. processors running software which has been compiled for the bog standard
  39. MC68000 processor. Most software has not been specifically compiled for
  40. faster processors and hence the potential for speed improvements are great.
  41.  
  42. On the 68000 processor there existed only multiplication & division routines
  43. for 16-bit numbers, on 68020`s and above divide & multiply instructions have
  44. been given extended precision. The 68020 can perform 32x32->32, 32x32->64 
  45. multiplication and 32/32 and 64/32 division. These are significantly faster 
  46. than the multi-precision operations which are required on the 68000. This was
  47. because in order to carry out any 32 Bit multiply or divides on the 68000 
  48. compilers where required to link in about three pages full of assembly code.
  49. This method not only wastes considerable amount of processor cycles, but 
  50. completly fails to take advantage of 68020, it can do the same calculation 
  51. in ONE instruction (excluding the RTS!) !
  52.  
  53. The program is based around ideas in a program called 'PatchMath020'.. that
  54. program tried to do similar things as this program.. infact it does indeed
  55. support 'Manx C' maths routines a few 'Lattice' function (but not all of 
  56. them!) ... My version supports 16 different strains and versions from
  57. the latest popular Amiga compilers including Lattice SAS/C, DICE, Manx, 
  58. Maxon, etc, etc, etc.
  59.  
  60. My program is like a replacement for his program, his could only patch a very 
  61. limited amount of programs since it knew so few. The only patch my one does
  62. not do that his does is his special case 'Turbo Silver' patch. At the moment
  63. don`t expect great gains from patching ray tracers since most maths functions 
  64. are sprawled all over the code instead of calling the compiler mul/div 
  65. functions. In the future I may consider doing special case patches for some
  66. particular programs to give them some *real* speed injections to their maths 
  67. functions. Some possible ones I`m thinking about are real maths intensive 
  68. programs like ray tracers such as "LightWave" and "Imagine"...  This all
  69. depends on if there is enough support for the idea, I know I could get these 
  70. slow "c" coded dinosaurs to got around 30 or 40% faster if I really tried... 
  71. What with code like 'divu #2,Dn' and so on... Anyone want to convice me its 
  72. worth the work?? 
  73.  
  74. Anyway, this was a quick few hours jobby, it does the trick, works fine but
  75. isn`t as well coded as it could have been (a bit unstructured!) I originally
  76. thoughed there was only about 6 different strains, it turns out that there
  77. are way in excess of 16+...  anyway I hope you like it and enjoy using your 
  78. patched programs faster!!!
  79.  
  80.  
  81.                        All The best from 2-Cool/EX4!
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.                               How it works..
  89.             --------------------------
  90.  
  91. For people who are sceptical that this program is a fake or a virus or
  92. something then please read below to remove your fears... Infact take a
  93. look at the source-code or even re-assemble it.. (THE FULL SOURCE-CODE
  94. IS SUPPLIED IN THE ARCHIVE! - SEE I`VE GOT NOTHING TO HIDE!)
  95.  
  96. This program scans a program looking for the standard MC68000 compiler
  97. produced maths functions and then replaces them with the faster MC68020
  98. equivelent code hence speeding up all maths functions in the program
  99. which used these routines.
  100.  
  101. Most programs written and compiled using the popular C language compiler
  102. development systems use these standard 'maths' routines for dividing and 
  103. multiplying functions. This is even the case if the Program has been
  104. specifically compiled for MC68020... (Will compiler writers ever learn?)
  105.  
  106. Many programs that use 32-bit maths intensively will run significantly
  107. faster after being pached by this program. Some programs after patching
  108. run 2 or even 3 times FASTER than the originals! On the average most
  109. programs will benefit from about 15 to 20% speed gains, which is better
  110. than nothing! It will depend entirely on how many calculations a program
  111. does using the patched routines..
  112.  
  113.  
  114.  
  115.                              The Patch List..
  116.             -------------------------
  117.  
  118. As this program is a generic patcher, currently not supporting any 
  119. specific optimisation patches it will patch MANY MANY programs. Infact at 
  120. a rough guess I would say about 2 thirds of all your software, be them,
  121. applications, utilities, tools, devices, libraries, datatypes, handlers,
  122. even games!
  123.  
  124.    Here`s a quick list of some popular programs which when patched are 
  125.                                  sped up!
  126.  
  127. -----------------------------------------------------------------------------
  128. Workbench             - tested on many WB3.0 files, including 
  129.                 - most "sys:prefs/#?" files, "sys:libs/#?"
  130.                 - "sys:l", "sys:devs", datatypes, etc.!
  131. Lattice SAS/C Compiler        - All amiga-shared libraries, lib:sc.lib,
  132.                 - and all executables even including the
  133.                 - compiler itself and all its libraries!
  134. DICE C Compiler            - most executables even including the
  135.                 - compiler itself and all its utilities
  136.                 - and linker libraries!
  137. Installer (Commodore)        - main program
  138. MUI                - main library
  139. ProCalc                - main program
  140. LightWave3D            - main program & also 'LightRave'
  141. Maxon Cinema-4D            - main program (also tested on demo versions)
  142. Devpac                - main text editor
  143. Twist                - main program
  144. MainActor            - main program
  145. AmiBack                - main program & tools suite
  146. Deluxe-Paint            - main program
  147. Personal-Paint            - main program
  148. Photogenics            - main library, 'pgs.library'
  149. Directory-Opus            - main program
  150. Final-Writer            - main program and most 'fwlibs' libraries
  151. Studio                - main program, CMSEdit, Printer Prefs, etc.
  152. GP-Fax                - main program and view fax program
  153. DMS (DiskMasher)        - both shell and gui versions
  154. Digita Organiser        - main program
  155. CygnusEd Professional        - main program
  156. PowerPacker            - main program
  157. PowerData            - main program
  158. Snap                - main program
  159. ARTM                - main program
  160. ACalc                - main program
  161. Arq                - main program
  162. FJPeg                - main program
  163. SuperView            - main program
  164. QuickGrab            - main program
  165. DiskExpander            - some parts including DevicePacker, etc.
  166. GameSmith            - Actual link-lib, CITAS, etc, even GS Games!
  167. GadToolsBox            - main program
  168. LhA-Windows            - main program
  169. LhA                - main program
  170. LZX                - all versions including 020 & 040
  171. Ami-Express            - main program & ACP Server
  172. S-Express            - main program & ACP Server
  173. PGP (Pretty Good Privacy)    - main program
  174. NComm                - main program
  175. Term                - main program
  176. FTerm                - main program
  177. ToolMaker            - main program
  178. SnoopDOS            - main program
  179. EasyCatalog            - main program
  180. CatComp                - main program
  181. CatEdit                - main program
  182. XModule                - main program
  183. ShowSTD                - main program
  184. PlusEd                - main program
  185. KingCON                - handler file usually located in l: dir
  186. Printer-Manager            - main program
  187.  
  188. many many libraries, devices, datatypes, handlers, etc. ,etc. including 
  189. popular ones like 'libs:xprzmodem.library' , 'libs:bullet.library', 
  190. 'libs:datatypes.library', 'libs:amigaguide.library', etc. etc.
  191.                                    ----
  192. This list is absolutely NO MEANS complete in any way, try it with all your
  193. programs, it will NOT damage or even touch programs which do not contain any
  194. of the complier C functions..
  195.  
  196. This program doesn`t just stop at utilities/tools and so on, TRY it on
  197. games too, here`s just a few we`ve tried;
  198.  
  199.  
  200. 1. PGATour Golf
  201. 2. Gunship 2000
  202. 3. A-Train
  203. 4. Silent-Service II
  204. 5. Monkey-Island II
  205. 6. Sim-Life
  206.  
  207.  
  208. etc., etc. Infact these days many Software Houses have dropped using Assembly
  209. language (sob..) so you`ll find many many games that can be patched too.. A 
  210. shame since they are just wasting the Amiga`s true potential... This program
  211. was written fully in assembly language ... hooray...): .. 
  212.  
  213.  
  214.  
  215. ------------------------------------------------------------------------------
  216.   PLEASE NOTE THAT BEFORE PATCHING *ANY* PROGRAMS, "MAKE A BACKUP COPY!"
  217.           OR SAVE THE PATCHED VERSION UNDER A DIFFERENT FILENAME!
  218.  
  219.                ALSO NOTE THAT THE NEW PATCHED PROGRAMS WILL 
  220.                 *** CRASH OR ENTIRELY LOCKUP THE SYSTEM ***
  221.               ON ANYTHING LOWER THAN AN MC68020.. HENCE DON`T
  222.         TRY THEM ON STANDARD A500`S OR OTHER AMIGA`S WITH MC68000`s
  223.  
  224.     This is very important since some programs have checksum protection
  225.    in to stop people modifying or trying to crack the registrations and
  226.     if patched will just crash due to the code failing the checksums..
  227.  
  228. -------------------------------------------------------------------------------
  229.  
  230.  
  231.  
  232.  
  233.                             Using the Program
  234.                      ---------------------------------
  235.  
  236. In order to use this program to its maximum you`ll need an executable file 
  237. unpacker.. This is especially true for games you may wish to patch since many
  238. come supplied in compressed format (to save diskspace). I recommend either
  239. the "XFD" package or "DLD" .. Both are varients from the same author, both
  240. allow easy transparent decompression of the many different compressed formats.
  241.  
  242. Once your sure that the program(s) you wish to patch are unpacked you can
  243. use the program in full AUTOMATIC BATCH mode...
  244.  
  245. Simply Enter its name from any Shell or CLI window;
  246.  
  247. 1> PatchFor020      <Hit Return>
  248.  
  249. You will then be prompted with a file requester with multi-selection
  250. capabilities... simply select an entire directory , e.g. the "libs:" dir
  251. then click on "ALL" on the requester to select all the files within it..
  252. You will be prompted with a further file-requester.. now you can select the 
  253. DESTINATION.. the destination is where all the patched versions of the programs
  254. will be placed... You can select <source> and <dest> as the same but I`d 
  255. strongly recommend to make backups of the files you are about to patch.....
  256.  
  257. NB: Also take note that if a file cannot be patched it will be skipped, and
  258. no saving of that particular file will take place...
  259.  
  260. Sorry about the sparse documents, but hey..its pretty simple to use.. -):
  261.  
  262.  
  263.  
  264.  
  265.                              Scope for Future
  266.                     ----------------------------------
  267.  
  268. The more maths varients I come across the more I`ll add, also mentioned 
  269. elsewhere in this document I *may* add some application specific speed up 
  270. patches. Currently this program only patches 'maths' routines in the future
  271. I`m considering replacement of other speed critical functions such as 
  272. standard compiler 'searching' routines, and so on.. this could benefit word
  273. processors and text editors, etc... 
  274.  
  275.  
  276.  
  277.  
  278. -------------------------------------------------------------------------------
  279.  
  280.  
  281.                              Disclaimer Notice
  282.             ---------------------------
  283.         No warrenties express or implied, use this program entirely
  284.        at your OWN risk.. If you trash one of your beloved programs
  285.        don`t come crying back to EX4.. Don`t say we didn`t warn you
  286.                             to keep backups!!!!
  287.  
  288.  
  289.  
  290.  
  291.  
  292.                                  Thanks to
  293.                          ------------------------
  294.  
  295.   Arthur Hagen, author of "CopyMemQuicker".. the routine is used in the 
  296.                      program for copying the patches,
  297.  
  298.           Nico Fraçias, author of the useful "Reqtools.library"..
  299.  
  300.                 Author of "PatchMatch020" for inspiration, 
  301.              (don`t know his name because it wasn`t specified)
  302.  
  303.  
  304.  
  305.  
  306.  
  307.                              Copyright Notice
  308.                     ----------------------------------
  309.  
  310.                     Based on idea`s from "PatchMaths"
  311.  
  312.                Designed & Written By 2-Cool/EX4 entirely in
  313.                            Assembly Language.
  314.  
  315.              Copyright EX4 (c) 1995. All Rights Are Reserved.
  316.  
  317.       The program itself may be freely distributed. However the program
  318.   and its source-code & documentation remain fully copyright to EX4 and 
  319.   its respective author(s). Permission is granted to put this on *NON*
  320.   profit making CD`s only! This program is NOT ALLOWED on *ANY* pay per 
  321.   minute (0898 style) commercial Bulletin Boards systems or equivelents. 
  322.  
  323.   YOU MUST NOT CHARGE ANY MONEY FOR TRANSFER, LOAN, HIRE OR USE OF THIS 
  324.   PROGRAM TO OTHER PARTIES, PEOPLE OR ORGANISATIONS. THE PROGRAM MUST BE 
  325.   DISTRIBUTED WITH THIS DOCUMENT AND ITS SOURCE-CODE. THE PROGRAM SOURCE
  326.   MUST NOT BE MODIFIED, PATCHED OR ALTERED IN ANY WAY THEN RE-DISTRIBUTED
  327.  
  328.  
  329.  
  330. ______________________________________________________________________________
  331.  
  332.  
  333.